package com.hmall.search.config;

import com.hmall.search.interceptor.ItemInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class SpringMvcSupport extends WebMvcConfigurationSupport {
    //注入拦截器和拦截地址
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new ItemInterceptor()).addPathPatterns("/**");
    }
}
